import VueRouter from 'vue-router'

// 14.1 创建底部四个路由组件，并导入

import HomeContainer from './components/tabbar/HomeContainer.vue'
import MemberContainer from './components/tabbar/MemberContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
// 8-10.2 导入新闻列表组件、
import NewsList from './components/news/NewsList.vue'
// 8-14.2 导入新闻详情页组件
import NewsInfo from './components/news/NewsInfo.vue'


// 3. 创建路由对象
var router = new VueRouter({
  routes: [  //配置路由规则的
      // 14.2 配置路由

      // 18.1  当时根路径时，让跳到主页面
      {path:"/",component:HomeContainer},
      {path:"/home",component:HomeContainer},
      {path:"/member",component:MemberContainer},
      {path:"/search",component:SearchContainer},
      {path:"/shopcar",component:ShopcarContainer},
      {path:"/home/newslist",component:NewsList},
      {path:"/home/newsinfo/:id",component:NewsInfo}
  ],
   //覆盖默认的路由的高亮的类，默认的类是router -link-cative
  linkActiveClass:"mui-active"   
})

// 把路由对象暴露出去
export default router